<?php

use think\migration\Seeder;

class Node extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run(): void
    {
        $this->insert('node', $this->nodeData());
    }

    protected function nodeData()
    {
        return [
            [
                'node_name' => '用户管理',
                'control_name' => "#",
                'action_name' => '#',
                'is_menu' => '2',
                'type_id' => '0',
                'style' => 'fa fa-users',
            ],
            [
                'node_name' => '管理员管理',
                'control_name' => "user",
                'action_name' => 'index',
                'is_menu' => '2',
                'type_id' => '1',
                'style' => '',
            ],
            [
                'node_name' => '添加管理员',
                'control_name' => "user",
                'action_name' => 'add',
                'is_menu' => '1',
                'type_id' => '2',
                'style' => '',
            ], [
                'node_name' => '编辑管理员',
                'control_name' => "user",
                'action_name' => 'edit',
                'is_menu' => '1',
                'type_id' => '2',
                'style' => '',
            ], [
                'node_name' => '删除管理员',
                'control_name' => "user",
                'action_name' => 'delete',
                'is_menu' => '1',
                'type_id' => '2',
                'style' => '',
            ], [
                'node_name' => '角色管理',
                'control_name' => "role",
                'action_name' => 'index',
                'is_menu' => '2',
                'type_id' => '1',
                'style' => '',
            ], [
                'node_name' => '添加角色',
                'control_name' => "role",
                'action_name' => 'add',
                'is_menu' => '1',
                'type_id' => '6',
                'style' => '',
            ], [
                'node_name' => '编辑角色',
                'control_name' => "role",
                'action_name' => 'edit',
                'is_menu' => '1',
                'type_id' => '6',
                'style' => '',
            ], [
                'node_name' => '删除角色',
                'control_name' => "role",
                'action_name' => 'delete',
                'is_menu' => '1',
                'type_id' => '6',
                'style' => '',
            ], [
                'node_name' => '分配权限',
                'control_name' => "role",
                'action_name' => 'giveaccess',
                'is_menu' => '1',
                'type_id' => '6',
                'style' => '',
            ], [
                'node_name' => '系统管理',
                'control_name' => "#",
                'action_name' => '#',
                'is_menu' => '2',
                'type_id' => '0',
                'style' => 'fa fa-desktop',
            ], [
                'node_name' => '节点管理',
                'control_name' => "node",
                'action_name' => 'index',
                'is_menu' => '2',
                'type_id' => '1',
                'style' => '',
            ], [
                'node_name' => '添加节点',
                'control_name' => "node",
                'action_name' => 'add',
                'is_menu' => '1',
                'type_id' => '12',
                'style' => '',
            ], [
                'node_name' => '编辑节点',
                'control_name' => "node",
                'action_name' => 'edit',
                'is_menu' => '1',
                'type_id' => '12',
                'style' => '',
            ], [
                'node_name' => '删除节点',
                'control_name' => "node",
                'action_name' => 'delete',
                'is_menu' => '1',
                'type_id' => '12',
                'style' => '',
            ], [
                'node_name' => '文章管理',
                'control_name' => "#",
                'action_name' => '#',
                'is_menu' => '2',
                'type_id' => '0',
                'style' => 'fa fa-book',
            ], [
                'node_name' => '文章列表',
                'control_name' => "articles",
                'action_name' => 'index',
                'is_menu' => '2',
                'type_id' => '16',
                'style' => '',
            ], [
                'node_name' => '添加文章',
                'control_name' => "articles",
                'action_name' => 'add',
                'is_menu' => '1',
                'type_id' => '16',
                'style' => '',
            ], [
                'node_name' => '编辑文章',
                'control_name' => "articles",
                'action_name' => 'edit',
                'is_menu' => '1',
                'type_id' => '16',
                'style' => '',
            ], [
                'node_name' => '删除文章',
                'control_name' => "articles",
                'action_name' => 'delete',
                'is_menu' => '1',
                'type_id' => '16',
                'style' => '',
            ], [
                'node_name' => '上传图片',
                'control_name' => "articles",
                'action_name' => 'uploadImg',
                'is_menu' => '1',
                'type_id' => '16',
                'style' => '',
            ], [
                'node_name' => '个人中心',
                'control_name' => "#",
                'action_name' => '#',
                'is_menu' => '1',
                'type_id' => '0',
                'style' => '',
            ], [
                'node_name' => '编辑信息',
                'control_name' => "profile",
                'action_name' => 'index',
                'is_menu' => '1',
                'type_id' => '22',
                'style' => '',
            ], [
                'node_name' => '编辑头像',
                'control_name' => "profile",
                'action_name' => 'headedit',
                'is_menu' => '1',
                'type_id' => '22',
                'style' => '',
            ], [
                'node_name' => '上传头像',
                'control_name' => "profile",
                'action_name' => 'uploadheade',
                'is_menu' => '1',
                'type_id' => '22',
                'style' => '',
            ]
        ];
    }
}